import Vue from 'vue'
import Router from 'vue-router'

// common：公用组件
import Home from '@/components/Home'
import Common from '@/components/Common'
import Login from '@/components/Login'

// user：用户个人信息抽屉
import UserInformation from '@/components/user/Information'
import UserDormitory from '@/components/user/DormitoryManager'
import UserSecurity from '@/components/user/Security'
import UserScore from '@/components/user/Score'
import OScore from '@/components/user/OScore'
import OSecurity from '@/components/user/OSecurity'



// admin：管理员路由
import AdminManager from '@/components/admin/AdminManager'
import DormitoryHeadManager from '@/components/admin/DormitoryHeadManager'
import TeacherManager from '@/components/admin/TeacherManager'
import StudentUnionManager from '@/components/admin/StudentUnionManager'
import HoursemasterManager from '@/components/admin/HoursemasterManager'
import Dormitory from '@/components/admin/Dormitory'
import Security from '@/components/admin/Security'
import Score from '@/components/admin/Score'


Vue.use(Router)

export default new Router({
  routes: [

    // 登录页面
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      component: Login
    },

    // 页面
    {
      path: '/home',
      component: Home,
      redirect: '/home/common',

      // 主页路由
      children: 
      [

        // 路由页面
        {
          path: '/home/common',
          component: Common
        },

        // 用户主页
        // 用户个人信息页面
        {
          path: '/user/information',
          component: UserInformation
        },


        // 全部user角色主页，宿舍管理
        {
          path: '/home/dormitory/user',
          component: UserDormitory
        },

        // 打分页面，教师，学生会，宿管可以看见
        {
          path: '/home/score/user',
          component: UserScore
        },

        // 安全问题页面，教师，学生会，宿管可以看见
        {
          path: '/home/security/user',
          component: UserSecurity
        },


        // 打分页面，教师，学生会，宿管可以看见
        {
          path: '/home/oscore/user',
          component: OScore
        },

        // 安全问题页面，教师，学生会，宿管可以看见
        {
          path: '/home/osecurity/user',
          component: OSecurity
        },


        // 管理员界面使用

        // 跳转到宿舍长页面
        {
          path: '/home/dormitoryhead/manager',
          component: DormitoryHeadManager
        },

        // 跳转到管理员页面
        {
          path: '/home/admin/manager',
          component: AdminManager
        },

        // 跳转到老师管理页面
        {
          path: '/home/teacher/manager',
          component: TeacherManager
        },

        // 学生会管理
        {
          path: '/home/studentunion/manager',
          component: StudentUnionManager
        },

        // 跳转到宿管管理页面
        {
          path: '/home/hoursemaster/manager',
          component: HoursemasterManager
        },

        // 跳转到宿舍页面

        {
          path: '/home/dormitory/manager',
          component: Dormitory
        },

        // 跳转到宿舍安全问题页面
        {
          path: '/home/security/manager',
          component: Security
        },

        // 跳到打分管理页面
        {
          path: '/home/score/manager',
          component: Score
        }
      ]
    }
    
  ]
})
